<?php
/* @var $this FavoriteController */
/* @var $model Favorite */

$this->breadcrumbs=array(
	'Favorites'=>array('index'),
	'Create',
);

$this->menu=array(
	array('label'=>'Sommaire', 'url'=>array('/')),		
);
?>

<?php 
Yii::app()->clientScript->registerScript('search', "
$('.add-button').click(function(){
	$('.add-form').toggle();
	return false;
});
");
?>


<h1><i>Gestion des coups de coeur</i></h1>

<div id="sidebar">
<?php
	$this->beginWidget('zii.widgets.CPortlet');
	$this->widget('zii.widgets.CMenu', array(
		'items'=>$this->menu,
		'htmlOptions'=>array('class'=>'operations'),
	));
	$this->endWidget();
?>
</div><!-- sidebar -->


<?php echo CHtml::link('Nouveau Coup de coeur','#',array('class'=>'add-button')); ?>
<div class="add-form" style="display:none">
<?php echo $this->renderPartial('_form', array('model'=>$model)); ?>
</div>


<?php $this->widget('zii.widgets.grid.CGridView', array(
	'id'=>'favorite-grid',
	'dataProvider'=>$model->search(),
	'columns'=>array(
		'idArea.name',
		'idLocation.name',
		array(
			'class'=>'CButtonColumn',
			'template'=>'{delete}',
		),
	),
)); ?>